<?php
use \Illuminate\Support\Facades\Route;
use Illuminate\Support\Facades\Auth;
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/', function () {
    return view('welcome');
});

//后台路由
Route::group(['prefix' => 'Admin','namespace'=>'Admin','middleware'=>['auth','checkpermission']], function() {
    //首页
    Route::get('/', 'IndexController@index')->name('admin.index.index');
    Route::get('Index', 'IndexController@index')->name('admin.index.index');
    Route::get('Index/index', 'IndexController@index')->name('admin.index.index');
    Route::get('Index/dashboard', 'IndexController@dashboard')->name('admin.index.dashboard');
    Route::get('Index/sysinfo', 'IndexController@sysinfo')->name('admin.index.sysinfo');
    Route::get('Index/skinConfig', 'IndexController@skinconfig')->name('admin.index.skinconfig');
    //菜单分组管理
    Route::get('SysMenuGroup/index', 'SysMenuGroupController@index')->name('admin.sysmenugroup.index');
    Route::post('SysMenuGroup/create', 'SysMenuGroupController@create')->name('admin.sysmenugroup.create');
    Route::post('SysMenuGroup/update', 'SysMenuGroupController@update')->name('admin.sysmenugroup.update');
    Route::post('SysMenuGroup/destroy', 'SysMenuGroupController@destroy')->name('admin.sysmenugroup.destroy');
    //菜单管理
    Route::get('SysMenu/index', 'SysMenuController@index')->name('admin.sysmenu.index');
    Route::post('SysMenu/create', 'SysMenuController@save')->name('admin.sysmenu.create');
    Route::post('SysMenu/update', 'SysMenuController@save')->name('admin.sysmenu.update');
    Route::post('SysMenu/destroy', 'SysMenuController@destroy')->name('admin.sysmenu.destroy');
    //权限管理
    Route::get('SysPermission/index','SysPermissionController@index')->name('admin.syspermission.index');
    Route::get('SysPermission/getJsTreeData', 'SysPermissionController@getJsTreeData')->name('admin.syspermission.getjstreedata');
    Route::get('SysPermission/getTreeOption', 'SysPermissionController@getTreeOption')->name('admin.syspermission.gettreeoption');
    Route::get('SysPermission/get', 'SysPermissionController@get')->name('admin.syspermission.get');
    Route::post('SysPermission/save', 'SysPermissionController@save')->name('admin.syspermission.save');
    Route::post('SysPermission/saveSort', 'SysPermissionController@saveSort')->name('admin.syspermission.savesort');
    Route::post('SysPermission/destroy', 'SysPermissionController@destroy')->name('admin.syspermission.destroy');
    //系统角色管理
    Route::get('SysRole/index', 'SysRoleController@index')->name('admin.sysrole.index');
    Route::post('SysRole/create', 'SysRoleController@save')->name('admin.sysrole.create');
    Route::post('SysRole/update', 'SysRoleController@save')->name('admin.sysrole.update');
    Route::post('SysRole/savePerm', 'SysRoleController@savePermission')->name('admin.sysrole.saveperm');
    Route::post('SysRole/destroy', 'SysRoleController@destroy')->name('admin.sysrole.destroy');
    //系统用户管理
    Route::get('SysUser/index', 'SysUserController@index')->name('admin.sysuser.index');
    Route::post('SysUser/create', 'SysUserController@save')->name('admin.sysuser.create');
    Route::post('SysUser/update', 'SysUserController@save')->name('admin.sysuser.update');
    Route::post('SysUser/editRole', 'SysUserController@editRole')->name('admin.sysuser.editrole');
    Route::post('SysUser/changestatus', 'SysUserController@changeStatus')->name('admin.sysuser.changestatus');
    //系统文件管理
    Route::get('SysFile/index', 'SysFileController@index')->name('admin.sysfile.index');
    Route::match(['get', 'post'], 'SysFile/ueditorUpload', 'SysFileController@ueditorUpload')->name('admin.sysfile.ueditorupload');
    Route::post('SysFile/webUpload', 'SysFileController@webUpload')->name('admin.sysfile.webupload');
    //微信用户组管理
    Route::get('WxUserTag/index', 'WxUserTagController@index')->name('admin.wxusertag.index');
    Route::post('WxUserTag/create', 'WxUserTagController@save')->name('admin.wxusertag.create');
    Route::post('WxUserTag/update', 'WxUserTagController@save')->name('admin.wxusertag.update');
    Route::post('WxUserTag/destroy', 'WxUserTagController@destroy')->name('admin.wxusertag.destroy');
    Route::post('WxUserTag/sync', 'WxUserTagController@sync')->name('admin.wxusertag.sync');
    //微信用户管理
    Route::get('WxUser/index', 'WxUserController@index')->name('admin.wxuser.index');
    Route::post('WxUser/setRemark', 'WxUserController@setRemark')->name('admin.wxuser.setremark');
    Route::post('WxUser/addTag', 'WxUserController@addTag')->name('admin.wxuser.addtag');
    Route::post('WxUser/setTag', 'WxUserController@setTag')->name('admin.wxuser.settag');
    Route::post('WxUser/setBlack', 'WxUserController@setBlack')->name('admin.wxuser.setblack');
    Route::post('WxUser/sync', 'WxUserController@sync')->name('admin.wxuser.sync');
    Route::post('WxUser/syncBlack', 'WxUserController@syncBlack')->name('admin.wxuser.syncblack');
    //微信菜单设置
    Route::get('WxMenu/index', 'WxMenuController@index')->name('admin.wxmenu.index');
    Route::post('WxMenu/create', 'WxMenuController@save')->name('admin.wxmenu.create');
    Route::post('WxMenu/update', 'WxMenuController@save')->name('admin.wxmenu.update');
    Route::post('WxMenu/destroy', 'WxMenuController@destroy')->name('admin.wxmenu.destroy');
    Route::post('WxMenu/sync', 'WxMenuController@sync')->name('admin.wxmenu.sync');
    Route::post('WxMenu/publish', 'WxMenuController@publish')->name('admin.wxmenu.publish');
    //短链接管理
    Route::get('WxShorturl/index', 'WxShorturlController@index')->name('admin.wxshorturl.index');
    Route::post('WxShorturl/create', 'WxShorturlController@save')->name('admin.wxshorturl.create');
    Route::post('WxShorturl/update', 'WxShorturlController@save')->name('admin.wxshorturl.update');
    Route::post('WxShorturl/destroy', 'WxShorturlController@destroy')->name('admin.wxshorturl.destroy');
    //二维码分组管理
    Route::get('WxQrcodeGroup/index', 'WxQrcodeGroupController@index')->name('admin.wxqrcodegroup.index');
    Route::post('WxQrcodeGroup/create', 'WxQrcodeGroupController@save')->name('admin.wxqrcodegroup.create');
    Route::post('WxQrcodeGroup/update', 'WxQrcodeGroupController@save')->name('admin.wxqrcodegroup.update');
    Route::post('WxQrcodeGroup/destroy', 'WxQrcodeGroupController@destroy')->name('admin.wxqrcodegroup.destroy');
    //二维码管理
    Route::get('WxQrcode/index', 'WxQrcodeController@index')->name('admin.wxqrcode.index');
    Route::post('WxQrcode/create', 'WxQrcodeController@save')->name('admin.wxqrcode.create');
    Route::post('WxQrcode/update', 'WxQrcodeController@save')->name('admin.wxqrcode.update');
    Route::post('WxQrcode/destroy', 'WxQrcodeController@destroy')->name('admin.wxqrcode.destroy');
    Route::get('WxQrcode/scanlog', 'WxQrcodeController@scanlog')->name('admin.wxqrcode.scanlog');
    //模板消息
    Route::get('WxTemplatemsg/index', 'WxTemplatemsgController@index')->name('admin.wxtemplatemsg.index');
    Route::post('WxTemplatemsg/setIndustry', 'WxTemplatemsgController@setIndustry')->name('admin.wxtemplatemsg.setIndustry');
    Route::post('WxTemplatemsg/create', 'WxTemplatemsgController@create')->name('admin.wxtemplatemsg.create');
    Route::post('WxTemplatemsg/update', 'WxTemplatemsgController@update')->name('admin.wxtemplatemsg.update');
    Route::post('WxTemplatemsg/destroy', 'WxTemplatemsgController@destroy')->name('admin.wxtemplatemsg.destroy');
    Route::post('WxTemplatemsg/sync', 'WxTemplatemsgController@sync')->name('admin.wxtemplatemsg.sync');
    Route::get('WxTemplatemsg/log', 'WxTemplatemsgController@log')->name('admin.wxtemplatemsg.log');
    //素材分类
    Route::get('WxMaterialCategory/index', 'WxMaterialCategoryController@index')->name('admin.wxmaterialcategory.index');
    Route::post('WxMaterialCategory/create', 'WxMaterialCategoryController@save')->name('admin.wxmaterialcategory.create');
    Route::post('WxMaterialCategory/update', 'WxMaterialCategoryController@save')->name('admin.wxmaterialcategory.update');
    Route::post('WxMaterialCategory/destroy', 'WxMaterialCategoryController@destroy')->name('admin.wxmaterialcategory.destroy');
    //图片素材
    Route::get('WxMaterialImage/index', 'WxMaterialImageController@index')->name('admin.wxmaterialimage.index');
    Route::post('WxMaterialImage/create', 'WxMaterialImageController@save')->name('admin.wxmaterialimage.create');
    Route::post('WxMaterialImage/update', 'WxMaterialImageController@save')->name('admin.wxmaterialimage.update');
    Route::post('WxMaterialImage/destroy', 'WxMaterialImageController@destroy')->name('admin.wxmaterialimage.destroy');
    Route::post('WxMaterialImage/upwx', 'WxMaterialImageController@upwx')->name('admin.wxmaterialimage.upwx');
    Route::post('WxMaterialImage/sync', 'WxMaterialImageController@sync')->name('admin.wxmaterialimage.sync');
    Route::get('WxMaterialImage/getChoice', 'WxMaterialImageController@getChoice')->name('admin.wxmaterialimage.getchoice');
    //图文素材
    Route::get('WxMaterialNews/index', 'WxMaterialNewsController@index')->name('admin.wxmaterialnews.index');
    Route::get('WxMaterialNews/create', 'WxMaterialNewsController@form')->name('admin.wxmaterialnews.create');
    Route::post('WxMaterialNews/create', 'WxMaterialNewsController@save')->name('admin.wxmaterialnews.create');
    Route::get('WxMaterialNews/update', 'WxMaterialNewsController@form')->name('admin.wxmaterialnews.update');
    Route::post('WxMaterialNews/update', 'WxMaterialNewsController@save')->name('admin.wxmaterialnews.update');
    Route::post('WxMaterialNews/destroy', 'WxMaterialNewsController@destroy')->name('admin.wxmaterialnews.destroy');
    Route::post('WxMaterialNews/upwx', 'WxMaterialNewsController@upwx')->name('admin.wxmaterialnews.upwx');
    Route::post('WxMaterialNews/sync', 'WxMaterialNewsController@sync')->name('admin.wxmaterialnews.sync');
    Route::get('WxMaterialNews/getChoice', 'WxMaterialNewsController@getChoice')->name('admin.wxmaterialnews.getchoice');
    //视频素材
    Route::get('WxMaterialVideo/index', 'WxMaterialVideoController@index')->name('admin.wxmaterialvideo.index');
    Route::post('WxMaterialVideo/create', 'WxMaterialVideoController@save')->name('admin.wxmaterialvideo.create');
    Route::post('WxMaterialVideo/update', 'WxMaterialVideoController@save')->name('admin.wxmaterialvideo.update');
    Route::post('WxMaterialVideo/destroy', 'WxMaterialVideoController@destroy')->name('admin.wxmaterialvideo.destroy');
    Route::post('WxMaterialVideo/upwx', 'WxMaterialVideoController@upwx')->name('admin.wxmaterialvideo.upwx');
    Route::post('WxMaterialVideo/sync', 'WxMaterialVideoController@sync')->name('admin.wxmaterialvideo.sync');
    Route::get('WxMaterialVideo/getChoice', 'WxMaterialVideoController@getChoice')->name('admin.wxmaterialvideo.getchoice');
    //音频素材
    Route::get('WxMaterialVoice/index', 'WxMaterialVoiceController@index')->name('admin.wxmaterialvoice.index');
    Route::post('WxMaterialVoice/create', 'WxMaterialVoiceController@save')->name('admin.wxmaterialvoice.create');
    Route::post('WxMaterialVoice/update', 'WxMaterialVoiceController@save')->name('admin.wxmaterialvoice.update');
    Route::post('WxMaterialVoice/destroy', 'WxMaterialVoiceController@destroy')->name('admin.wxmaterialvoice.destroy');
    Route::post('WxMaterialVoice/upwx', 'WxMaterialVoiceController@upwx')->name('admin.wxmaterialvoice.upwx');
    Route::post('WxMaterialVoice/sync', 'WxMaterialVoiceController@sync')->name('admin.wxmaterialvoice.sync');
    Route::get('WxMaterialVoice/getChoice', 'WxMaterialVoiceController@getChoice')->name('admin.wxmaterialvoice.getchoice');
    //微信自动回复
    Route::get('WxAutoreply/index', 'WxAutoreplyController@index')->name('admin.wxautoreply.index');
    Route::get('WxAutoreply/create', 'WxAutoreplyController@form')->name('admin.wxautoreply.create');
    Route::post('WxAutoreply/create', 'WxAutoreplyController@save')->name('admin.wxautoreply.create');
    Route::get('WxAutoreply/update', 'WxAutoreplyController@form')->name('admin.wxautoreply.update');
    Route::post('WxAutoreply/update', 'WxAutoreplyController@save')->name('admin.wxautoreply.update');
    Route::post('WxAutoreply/destroy', 'WxAutoreplyController@destroy')->name('admin.wxautoreply.destroy');
    //微信群发
    Route::get('WxMass/index', 'WxMassController@index')->name('admin.wxmass.index');
    Route::get('WxMass/create', 'WxMassController@form')->name('admin.wxmass.create');
    Route::post('WxMass/create', 'WxMassController@save')->name('admin.wxmass.create');
    Route::get('WxMass/update', 'WxMassController@form')->name('admin.wxmass.update');
    Route::post('WxMass/update', 'WxMassController@save')->name('admin.wxmass.update');
    Route::post('WxMass/destroy', 'WxMassController@destroy')->name('admin.wxmass.destroy');
    Route::post('WxMass/preview', 'WxMassController@preview')->name('admin.wxmass.preview');
    Route::post('WxMass/syncStatus', 'WxMassController@syncStatus')->name('admin.wxmass.syncstatus');
    Route::match(['get', 'post'], 'WxMass/upSetSpeed', 'WxMassController@upSetSpeed')->name('admin.wxmass.upsetspeed');
    //群发结果
    Route::get('WxMassResult/index', 'WxMassResultController@index')->name('admin.wxmassresult.index');
    //群发图文留言
    Route::get('WxMassComment/index', 'WxMassCommentController@index')->name('admin.wxmasscomment.index');
    Route::get('WxMassComment/comment', 'WxMassCommentController@comment')->name('admin.wxmasscomment.comment');
    Route::post('WxMassComment/open', 'WxMassCommentController@open')->name('admin.wxmasscomment.open');
    Route::post('WxMassComment/markelect', 'WxMassCommentController@markelect')->name('admin.wxmasscomment.markelect');
    Route::post('WxMassComment/delete', 'WxMassCommentController@delete')->name('admin.wxmasscomment.delete');
    Route::post('WxMassComment/replyAdd', 'WxMassCommentController@replyAdd')->name('admin.wxmasscomment.replyadd');
    Route::post('WxMassComment/replyDelete', 'WxMassCommentController@replyDelete')->name('admin.wxmasscomment.replydelete');
    //微信卡券
    Route::get('WxCard/index', 'WxCardController@index')->name('admin.wxcard.index');
    Route::get('WxCard/create', 'WxCardController@form')->name('admin.wxcard.create');
    Route::post('WxCard/create', 'WxCardController@save')->name('admin.wxcard.create');
    Route::get('WxCard/update', 'WxCardController@form')->name('admin.wxcard.update');
    Route::post('WxCard/update', 'WxCardController@save')->name('admin.wxcard.update');
    Route::post('WxCard/destroy', 'WxCardController@destroy')->name('admin.wxcard.destroy');
    Route::post('WxCard/publish', 'WxCardController@publish')->name('admin.wxcard.publish');
    Route::post('WxCard/sync', 'WxCardController@sync')->name('admin.wxcard.sync');
    Route::post('WxCard/modifyStock', 'WxCardController@modifyStock')->name('admin.wxcard.modifystock');
    Route::match(['get', 'post'], 'WxCard/upsetTestWhite', 'WxCardController@upsetTestWhite')->name('admin.wxcard.upsettestwhite');
    //微信卡券-领券记录
    Route::get('WxCardReceive/index', 'WxCardReceiveController@index')->name('admin.wxcardreceive.index');
    Route::post('WxCardReceive/updateCode', 'WxCardReceiveController@updateCode')->name('admin.wxcardreceive.updatecode');
    Route::post('WxCardReceive/disable', 'WxCardReceiveController@disable')->name('admin.wxcardreceive.disable');
    Route::get('WxCardReceive/transfer', 'WxCardReceiveController@transfer')->name('admin.wxcardreceive.transfer');
    //微信卡券-投放二维码
    Route::get('WxCardQrcode/index', 'WxCardQrcodeController@index')->name('admin.wxcardqrcode.index');
    Route::post('WxCardQrcode/create', 'WxCardQrcodeController@save')->name('admin.wxcardqrcode.create');
    Route::post('WxCardQrcode/update', 'WxCardQrcodeController@save')->name('admin.wxcardqrcode.update');
    Route::post('WxCardQrcode/destroy', 'WxCardQrcodeController@destroy')->name('admin.wxcardqrcode.destroy');
    Route::post('WxCardQrcode/publish', 'WxCardQrcodeController@publish')->name('admin.wxcardqrcode.publish');
    //微信卡券-会员卡会员等级
    Route::get('WxCardMemberLevel/index', 'WxCardMemberLevelController@index')->name('admin.wxcardmemberlevel.index');
    Route::post('WxCardMemberLevel/create', 'WxCardMemberLevelController@save')->name('admin.wxcardmemberlevel.create');
    Route::post('WxCardMemberLevel/update', 'WxCardMemberLevelController@save')->name('admin.wxcardmemberlevel.update');
    Route::post('WxCardMemberLevel/destroy', 'WxCardMemberLevelController@destroy')->name('admin.wxcardmemberlevel.destroy');
    //微信卡券-会员列表
    Route::get('WxCardMemberList/index', 'WxCardMemberListController@index')->name('admin.wxcardmemberlist.index');
    Route::get('WxCardMemberList/count', 'WxCardMemberListController@count')->name('admin.wxcardmemberlist.count');

    //微信消息管理
    Route::get('Wxmsg/text', 'WxmsgController@text')->name('admin.wxmsg.text');
    Route::get('Wxmsg/image', 'WxmsgController@image')->name('admin.wxmsg.image');
    Route::get('Wxmsg/voice', 'WxmsgController@voice')->name('admin.wxmsg.voice');
    Route::get('Wxmsg/video', 'WxmsgController@video')->name('admin.wxmsg.video');
    Route::get('Wxmsg/shortvideo', 'WxmsgController@shortvideo')->name('admin.wxmsg.shortvideo');
    Route::get('Wxmsg/location', 'WxmsgController@location')->name('admin.wxmsg.location');
    Route::get('Wxmsg/link', 'WxmsgController@link')->name('admin.wxmsg.link');
    Route::get('Wxmsg/event', 'WxmsgController@event')->name('admin.wxmsg.event');
    Route::get('Wxmsg/send', 'WxmsgController@send')->name('admin.wxmsg.send');
});

//认证
Auth::routes();

Route::get('/home', 'HomeController@index')->name('home');

//微信相关
Route::any('/wechat/serve', 'Wechat\WechatController@serve');
//微信页面

//'wechat.oauth'
Route::group(['prefix' => 'wechat','namespace'=>'Wechat','middleware'=>['wechat.oauth']], function() {
    //图文素材查看页
    Route::get('/news/view', 'NewsController@view')->name('wechat.news.view');
});

//设置访问
\Laravel\Horizon\Horizon::auth(function ($request) {
    return true;
});